package com.hznu.jspFinal.service;

import com.hznu.jspFinal.dao.KpointMapper;
import com.hznu.jspFinal.entity.Kpoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author:wp
 * time 10:23 2018/06/07
 */
@Service
public class KpointServiceImpl implements  KpointService{

    @Autowired
    private KpointMapper kpointMapper;
    @Override
    public int addOne(Kpoint kpoint) {
        return kpointMapper.insertSelective(kpoint);
    }

    @Override
    public int update(Kpoint kpoint) {
        return kpointMapper.updateByPrimaryKeySelective(kpoint);
    }

    @Override
    public int delete(Integer id) {
        return kpointMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Kpoint findById(Integer id) {
        return kpointMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Kpoint> findByCourseid(Integer id) {
        return kpointMapper.selectByCourseid(id);
    }
}
